﻿using System;

namespace MAF.Common
{
    /// <summary>
    /// 值对象基类
    /// </summary>
    public class BaseEntity : IID<Guid>
    {
        /// <summary>
        /// 构造方法
        /// </summary>
        public BaseEntity()
        {
            CreatedBy = Guid.Empty;
            CreatedOn = DateTime.Now;
            ModifiedBy = null;
            ModifiedOn = null;

            Id = CombGuid.NewGuid();
        }

        /// <summary>
        /// 创建人
        /// </summary>
        public Guid CreatedBy { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedOn { get; set; }
        
        /// <summary>
        /// 修改人
        /// </summary>
        public Guid? ModifiedBy { get; set; }
        
        /// <summary>
        /// 修改时间
        /// </summary>
        public DateTime? ModifiedOn { get; set; }
        
        /// <summary>
        /// ID
        /// </summary>
        public virtual Guid Id { get; set; }
    }
}
